home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 1.7 KB | 72 lines | [TEXT/CWIE] |
- // ViewMap.h
-
- #ifndef ViewMap_h
- #define ViewMap_h
-
- #ifndef RegionObject_h
- #include "RegionObject.h"
- #endif
-
- class View;
- class WindowObject;
- class GrafPortObject;
-
- class ViewMap
- {
- private:
- WindowObject *window;
- Rectangle bounds;
- RegionObject clip;
- bool visible;
- Rectangle visibleBounds;
-
- const ViewMap *previous;
- static const ViewMap *current;
-
- static RegionObject& Invalid( const WindowObject& );
-
- void SetToVisible( const View& );
-
- public:
- enum IncludeInvalid { includeInvalid };
- enum InvalidOnly { invalidOnly };
-
- ViewMap( const View& );
- ViewMap( const View&, IncludeInvalid );
- ViewMap( const View&, InvalidOnly );
- ViewMap( const ViewMap& );
-
- ~ViewMap();
-
- void operator=( const ViewMap& );
- void Set( const ViewMap&, const Rectangle& restriction );
-
- bool HasWindow() const { return window != 0; }
-
- const WindowObject& Window() const { Assert( window != 0 ); return *window; }
- GrafPortObject& Port() const;
- const Rectangle& Bounds() const { Assert( window != 0 ); return bounds; }
- const RegionObject& Clip() const { Assert( window != 0 ); return clip; }
- bool Visible() const { return visible; }
- const Rectangle& VisibleBounds() const { Assert( visible ); return visibleBounds; }
-
- void RestrictTo( const Rectangle& );
- void RestrictTo( const RegionObject& );
-
- void Validate() const;
- void Validate( const Rectangle& ) const;
- void Validate( const RegionObject& ) const;
-
- void Invalidate() const;
- void Invalidate( const Rectangle& ) const;
- void Invalidate( const RegionObject& ) const;
-
- void Erase() const;
- void Erase( const Rectangle& ) const;
- void Erase( const RegionObject& ) const;
-
- void Reassert() const;
- };
-
- #endif
-